package com.atguigu.day04;

import java.util.Scanner;

public class Test5 {

    public static void main(String[] args) {
        int year;
        int month;
        int day;
        Scanner s = new Scanner(System.in);
        System.out.print("请输入年:");
        year = s.nextInt();
        System.out.print("请输入月:");
        month = s.nextInt();
        System.out.print("请输入日:");
        day = s.nextInt();
        int days = 0;
        for (int i = 0; i <= month; i++) {
            if (i == 1)
                days += 0;
            if (i == 2 || i == 4 || i == 6 || i == 8 || i == 9 || i == 11)
                days += 31;
            if (i == 3) {
                if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)
                    days += 29;
                else
                    days += 28;
            }
            if (i == 5 || i == 7 || i == 10 || i == 12)
                days += 30;
        }
//        switch (month){
//            case 12:
//                days+=30;
//            case 11:
//                days+=31;
//            case 10:
//                days+=30;
//            case 9:
//                days+=31;
//            case 8:
//                days+=31;
//            case 7:
//                days+=30;
//            case 6:
//                days+=31;
//            case 5:
//                days+=30;
//            case 4:
//                days+=31;
//            case 3:
//                if (year%4==0&&year%100!=0||year%400==0)
//                    days+=29;
//                else
//                    days+=28;
//            case 2:
//                days+=31;
//            case 1:
//                days+=day;
//                break;
//        }
        days += day;
        System.out.println(year + "年" + month + "月" + day + "日是这一年的第" + days + "天");
        s.close();
    }
}
